<template>
  <div class="todo-time-box">
    <h2 class="todo-time">{{time | formatTime}}</h2>
  </div>
</template>

<script>
export default {
  data() {
    return {
      time: Date.now()
    }
  },
  filters: {
    formatTime(timestamp) {
      let timeObj = new Date(timestamp)
      let y = timeObj.getFullYear()
      let m = timeObj.getMonth() + 1
      let d = timeObj.getDate()
      return `${y}年${m}月${d}日`
    }
  }
};
</script>

<style>
</style>